import { environment } from '../environments/environment';

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpModule } from '@angular/http';
import { AppComponent } from './app.component';
import { CusindexComponent } from './cusindex/cusindex.component';
import { CusindexService } from './cusindex/service/cusindex.service';
import { RouterModule, Routes } from '@angular/router';
import { APP_BASE_HREF, LocationStrategy, HashLocationStrategy } from '@angular/common';

import 'rxjs/Rx';

const appRoutes: Routes = [
  { path: 'cusindex', component: CusindexComponent }
];


@NgModule({
  declarations: [
    AppComponent,
    CusindexComponent
  ],
  imports: [
    BrowserModule,
    HttpModule,
    RouterModule.forRoot(
      appRoutes,
      { enableTracing: true } // <-- debugging purposes only
    )
  ],
  providers: [
    CusindexService,
    {provide: APP_BASE_HREF, useValue: environment.publicBase},
    {provide: LocationStrategy, useClass: HashLocationStrategy}
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }
